<?php
if ( $is_print ) {
	header('Content-type: application/vnd.ms-excel');
	header('Content-Disposition: attachment; filename=Order with Option List ' .strtotime('now').'.xls');
}
?>

<table border=1>
	<tr><th>{{ implode('</th><th>', $headers) }}</th></tr>
	@foreach( $items as $value )
		<tr>
			<td>{{ $value['ORDER_id'] }}</td>
			<td>{{ $statuses[$value['order_status']] }}</td>
			<td>{{ $value['id'] }}</td>
			<td>{{ $statuses[$value['item_status']] }}</td>
			<td>{{ $value['employee_number'] }}</td>
			<td>{{ $value['firstname'] }}</td>
			<td>{{ $value['lastname'] }}</td>
			<td>{{ $value['email'] }}</td>
			<td>{{ $value['company_code'] }}</td>
			<td>{{ $value['branch_code'] }}</td>
			<td>{{ $value['name'] }}</td>
			<td>{{ $value['model'] }}</td>
			<td>{{ $value['category'] }}</td>
			<td>{{ $value['size'] }}</td>
			<td>{{ number_format($value['benstore_price'], 2) }}</td>
			<td>{{ $value['quantity'] }}</td>
			@foreach ( $option_cols as $col )
				@if ( $col == $value['prod_opt_id'] )
					<td>{{ $value['option_value'] }}</td>
					<td>{{ $value['option_price'] }}</td>
					<td>{{ $value['option_quantity'] }}</td>
				@else
					<td></td>
					<td></td>
					<td></td>
				@endif
			@endforeach
			<td>{{ number_format($value['delivery_fee_peso'], 2) }}</td>
			<td>{{ number_format($value['delivery_fee_points'], 2) }}</td>
			<td>{{ number_format($value['peso'], 2) }}</td>
			<td>{{ number_format($value['tax'], 2) }}</td>
			<td>{{ number_format($value['points'], 2) }}</td>
			<td>{{ number_format($value['topup'], 2) }}</td>
			<td>{{ $value['comment'] }}</td>
		</tr>
	@endforeach
</table>